<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="<?php echo $this->_webroot('skin/css/admin.css'); ?>">
<link rel="stylesheet" type="text/css" href="<?php echo $this->_webroot('skin/css/main.css'); ?>">
<style>
td span {color:red;}
</style>
</head>
<body>
<div id="maincontent">
<psp:tags     htmlname='messagebox'  iconname='messagebox' />
	<div class="wrap">
	<div class="crumbs">当前位置 &gt;&gt; 商品管理 &gt;&gt; 修改品牌</div>
        <hr />
	<div class="infobox">
<h3><span class="left">添加品牌</span> <span style=" margin-right:15p;" class="right"><a href="<?php echo $this->_url('admin/brand/categorieslist');?>">品牌列表</a>&nbsp;&nbsp;</span></h3>
    <div class="content2">
			<form action="<?php echo $this->_url('admin/brand/categoriesedit/'.$info['id']);?>" method="post" onsubmit="return checkform();" enctype="multipart/form-data">
			<table class="form-table">
			<tr>
				<td width="63px;">品牌名称：</td>
				<td><input class="small-text" type="text" name="data[brand][brand_name]" value="<?php echo $info['brand_name']; ?>" /> <span>*</span></td>
			</tr>
			<tr>
				<td>品牌介绍：</td>
				<td><textarea name="data[brand][brand_desc]" style="width:200px; height:50px;"><?php echo $info['brand_desc']; ?></textarea></td>
			</tr>
			<tr>
				<td>链接网址：</td>
				<td><input class="small-text" type="text" name="data[brand][site_url]" value="<?php echo $info['site_url']; ?>" /></td>
			</tr>
			<tr>
				<td>品牌logo：</td>
				<td><input type="file" name="logo[]" /></td>
			</tr>
			<tr>
				<td>关联分类</td>
				<td>
					<select name="data[cat][][cat_id]" id="cat_id" multiple style="width:190px; height:300px;  overflow:auto;">
						<?php foreach($category_dg as $value) {?>
							<option value="<?php echo $value['id'];?>" <?php if(in_array($value['id'],$category_brand_list)){echo "selected";}?>><?php echo $value['str_pad'];?><?php echo $value['cat_name'];?></option>
						<?php }?>
					</select>
				</td>
			</tr>
			<tr>
				<td>是否显示：</td>
				<td><input type="checkbox" name="data[brand][is_show]" value="1" <?php if ($info['is_show']){ echo "checked";} ?> />显示 </td>
			</tr>
			<tr>
				<td colspan="2"><span class="button-container"><input class="regular-button" type="submit" name="submit" value="修改品牌" /></td>
			</tr>
			</table>
			</form>
		  </div>
		 </div>
		</div>
	</div>
<script>
function checkform() {
	var type_name = document.getElementsByName('brand_name')[0];
	var site_url = document.getElementsByName('site_url')[0];
	var checkfiles=new RegExp("((^http)|(^https)|(^ftp)):\/\/(\\w)+\.(\\w)+");
	if(site_url.value!='') {
		if(!checkfiles.test(site_url.value)) {
			ShowMessageBox("网站格式不正确！",'0');
			return false;
		}
	}
	if(type_name.value=='') {
		ShowMessageBox("名称不能为空！",'0');
		return false;
	}
	return true;
}
</script>
</body>
</html>